using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Enemy1 : MonoBehaviour
{
    // Start is called before the first frame update
    public GameObject targrt;
    private Rigidbody2D rb;

    void Start()
    {
        rb = GetComponent<Rigidbody2D>();
        rb.gravityScale = 0.0f;
    }

    void OnCollisionEnter2D(Collision2D collision)
    {
            Destroy(this.gameObject);
    }
    // Update is called once per frame
    void Update()
    {
        
        if (targrt.transform.position.x > -1 && targrt.transform.position.x < 0 &&targrt.transform.position.y < -2 )
        {
            rb.gravityScale = 3.0f;
            
        }
       
    }
}
